import React, { useEffect, useState } from 'react'
import './style.module.less'
import Header from './components/Header'
import House from './components/House'
import More from './components/More'
import Deal from './components/Deal'
import Botton from './components/Botton'
import { useStore, observer } from '@/store'
import { useNavigate } from 'react-router-dom';


const Home = () => {
  const { homeStore,userStore } = useStore()
  const navigate = useNavigate()
  useEffect(()=>{
    if (!JSON.parse(localStorage.getItem('token'))) {
      navigate('/login')
    }
    homeStore.arr = homeStore.recommendItem
  })

  return (
    <div className="header">

      <Header />
      <House />
      <More />
      <Deal />
      <Botton />


    </div>

  )
}


export default observer(Home)